package com.le.tester.imooc.masterJUC.immutable;

import java.util.HashSet;
import java.util.Set;

/**
 * 描述：不可变
 */
public class ImmutableDemo {
    private final Set<String> students = new HashSet<>();

    public ImmutableDemo() {
        students.add("李小梅");
        students.add("王壮");
        students.add("徐福记");
    }

    public boolean isStudent(String name) {
        return students.contains(name);
    }
}
